package com.haobangs.imms.service.impl;


import com.haobangs.imms.service.IVideoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;


/**
 * 设备管理Service业务层处理
 *
 * @author haobangs
 * @date 2023-06-11
 */
@Service
public class VideoServiceImpl implements IVideoService
{
    /**
     * 查询视频播放地址的url
     *
     * @param
     * @return 查询报警设备的结果
     */
    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    @Override
    public Map<String, Object> getvideo(){
        String url = "ezopen://open.ys7.com/BB5522191/1.hd.live";
        String accessToken = stringRedisTemplate.opsForValue().get("YinshiaccessToken");
        if (accessToken  == null) {
            accessToken = "at.9tieowpz2yefh6ac58lgbibbdksk520s-9rj6p4cxri-1ck1d52-va2qmbogn";
        }
        Map<String, Object> map1 = new HashMap<>();
        map1.put("accessToken", accessToken);
        map1.put("Url", url);

        return map1;
    }

}
